package com.design.pattern.creational.prototype;

/**
 * description
 *
 * @author RenQiQiang 2019/03/31 13:14
 */
public class Test {

    public static void main(String[] args) throws CloneNotSupportedException {
        Mail mail = new Mail();
        mail.setContent("初始化模板");
        System.out.println("初始化mail"+mail);
        for(int i = 0; i < 10; i++) {
            Mail temp = (Mail) mail.clone();
            temp.setName("姓名"+i);
            temp.setEmailAddress(i+"@qq.com");
            temp.setContent("恭喜你，中奖了");
            MailUtil.sendMail(temp);
            System.out.println("克隆出来的：" + temp);
        };
        MailUtil.saveOriginMailRecord(mail);
    }
}
